package com.routz.wxarticlelist.demo.wx_util.service;

import com.routz.wxarticlelist.demo.wx_util.entity.WxConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WxConfigFactory {
    private static WxConfigFactory ourInstance = new WxConfigFactory();

    public static WxConfigFactory getInstance() {
        return ourInstance;
    }

    private WxConfigFactory() {
    }

    public WxConfig getWxConfig() {
        return wxConfigService.getById(1);
    }

    public void setWxConfig(WxConfig wxConfig) {
        wxConfigService.updateById(wxConfig);
    }

    @Autowired
    private IWxConfigService wxConfigService;
}
